package com.imti.mall.sale.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.imti.mall.model.sms.pojo.SmsFlashPromotion;
import com.imti.mall.model.sms.pojo.SmsHomeBrand;
import com.imti.mall.sale.dao.SmsHomeBrandDao;
import com.imti.mall.sale.service.SmsHomeBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SmsHomeBrandServiceImpl extends ServiceImpl<SmsHomeBrandDao, SmsHomeBrand> implements SmsHomeBrandService{
    @Autowired
    SmsHomeBrandDao smsHomeBrandDao;

    /**
     * 查询品牌推荐列表
     */
    @Override
    public List<SmsHomeBrand> findBrand(SmsHomeBrand smsHomeBrand, Integer pageSize, Integer pageNum) {
        PageHelper.startPage(pageNum, pageSize);
        return smsHomeBrandDao.findBrand(smsHomeBrand);
    }
    /**
     * 修改品牌推荐
     * @param smsHomeBrand
     * @return
     */
    @Override
    public Integer updateSmsHomeBrand(SmsHomeBrand smsHomeBrand) {
        return smsHomeBrandDao.updateSmsHomeBrand(smsHomeBrand);
    }
    /**
     * 根据id删除品牌推荐
     * @param id
     * @return
     */
    @Override
    public Integer delSmsHomeBrand(Integer id) {
        return smsHomeBrandDao.deleteById(id);
    }
    /**
     * 添加品牌推荐
     * @param smsHomeBrand
     * @return
     */
    @Override
    public boolean addSmsHomeBrand(List<SmsHomeBrand> smsHomeBrand) {
        return saveBatch(smsHomeBrand);
    }
}
